home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / gg / gengetopt-2.6.lha / gengetopt-2.6 / acinclude.m4 < prev    next >
M4 Source File  |  2001-02-09  |  3KB  |  108 lines

  1. dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
  2. dnl  
  3. dnl This program is free software; you can redistribute it and/or modify
  4. dnl it under the terms of the GNU General Public License as published by
  5. dnl the Free Software Foundation; either version 2 of the License, or
  6. dnl (at your option) any later version.
  7. dnl 
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. dnl GNU General Public License for more details.
  12. dnl 
  13. dnl You should have received a copy of the GNU General Public License
  14. dnl along with this program; if not, write to the Free Software 
  15. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. dnl 
  17. dnl As a special exception to the GNU General Public License, if you distribute
  18. dnl this file as part of a program that contains a configuration script 
  19. dnl generated by Autoconf, you may include it under the same distribution 
  20. dnl terms that you use for the rest of that program.
  21.  
  22. AC_DEFUN(LF_PROG_TXTC,[
  23.   AC_MSG_CHECKING(for the txtc compiler)
  24.   TXTC='$(SHELL) $(top_builddir)/txtc.sh'
  25.   if test -f $srcdir/txtc.sh.in
  26.   then
  27.     AC_MSG_RESULT(yes)  
  28.   else
  29.     AC_MSG_RESULT(no)
  30.     AC_MSG_WARN([Cannot find the txtc.sh compiler.])
  31.     AC_MSG_WARN([Please use the mktxtc utility to generate one at the]), 
  32.     AC_MSG_WARN([toplevel directory, otherwise this package will not compile.])
  33.   fi
  34.   AC_SUBST(TXTC)
  35. ])
  36.  
  37. dnl @synopsis AC_COMPILE_WARNINGS
  38. dnl
  39. dnl Set the maximum warning verbosity according to compiler used.
  40. dnl Currently supports g++ and gcc.
  41. dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in
  42. dnl configure.in
  43. dnl
  44. dnl @version $Id: acinclude.m4,v 1.2 2001/02/09 18:17:14 bettini Exp $
  45. dnl @author Loic Dachary <loic@senga.org>
  46. dnl
  47. AC_DEFUN(AC_COMPILE_WARNINGS,
  48. [AC_MSG_CHECKING(maximum warning verbosity option)
  49. if test -n "$CXX"
  50. then
  51.   if test "$GXX" = "yes"
  52.   then
  53.     ac_compile_warnings_opt='-Wall'
  54.   fi
  55.   CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
  56.   ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
  57. fi
  58.  
  59. if test -n "$CC"
  60. then
  61.   if test "$GCC" = "yes"
  62.   then
  63.     ac_compile_warnings_opt='-Wall'
  64.   fi
  65.   CFLAGS="$CFLAGS $ac_compile_warnings_opt"
  66.   ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
  67. fi
  68. AC_MSG_RESULT($ac_compile_warnings_msg)
  69. unset ac_compile_warnings_msg
  70. unset ac_compile_warnings_opt
  71. ])
  72.  
  73. dnl Copyright (C) 2001 Lorenzo Bettini <bettini@gnu.org>
  74. dnl  
  75. dnl This program is free software; you can redistribute it and/or modify
  76. dnl it under the terms of the GNU General Public License as published by
  77. dnl the Free Software Foundation; either version 2 of the License, or
  78. dnl (at your option) any later version.
  79.  
  80. dnl @synopsis AC_NONGNU_FLAGS
  81. dnl
  82. dnl check if the non-GNU C compiler accepts -Aa (HP-UX)
  83.  
  84. AC_DEFUN(AC_NONGNU_FLAGS,
  85. [
  86.   if test -z "$GCC"; then
  87.     AC_CC_AA_FLAG
  88.     if test $ac_cv_cc_aa_flag = yes; then
  89.       CFLAGS="$CFLAGS -Aa"
  90.     fi
  91.   fi
  92. ])
  93.  
  94. dnl @synopsis AC_CC_AA_FLAG
  95. dnl
  96. dnl check if the C compiler accepts -Aa (HP-UX)
  97.  
  98. AC_DEFUN(AC_CC_AA_FLAG,
  99. [AC_CACHE_CHECK(whether ${CC-cc} accepts -Aa, ac_cv_cc_aa_flag,
  100. [echo 'void f(){}' > conftest.c
  101. if test -z "`${CC-cc} -Aa -c conftest.c 2>&1`"; then
  102.   ac_cv_cc_aa_flag=yes
  103. else
  104.   ac_cv_cc_aa_flag=no
  105. fi
  106. rm -f conftest*
  107. ])])
  108.